/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gap.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Yunita
 */
@Entity
@Table(name = "gap_transaction_employee_detail")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "GapTransactionEmployeeDetail.findAll", query = "SELECT g FROM GapTransactionEmployeeDetail g"),
//    @NamedQuery(name = "GapTransactionEmployeeDetail.findBySync", query = "SELECT g FROM GapTransactionEmployeeDetail g WHERE g.sync = :sync"),
//    @NamedQuery(name = "GapTransactionEmployeeDetail.findByPosDetailId", query = "SELECT g FROM GapTransactionEmployeeDetail g WHERE g.posDetailId = :posDetailId"),
//    @NamedQuery(name = "GapTransactionEmployeeDetail.findByPosDetailDiscount", query = "SELECT g FROM GapTransactionEmployeeDetail g WHERE g.posDetailDiscount = :posDetailDiscount"),
//    @NamedQuery(name = "GapTransactionEmployeeDetail.findByPosDetailPrice", query = "SELECT g FROM GapTransactionEmployeeDetail g WHERE g.posDetailPrice = :posDetailPrice"),
//    @NamedQuery(name = "GapTransactionEmployeeDetail.findByPosDetailNett", query = "SELECT g FROM GapTransactionEmployeeDetail g WHERE g.posDetailNett = :posDetailNett")})
public class GapTransactionEmployeeDetail implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "pos_detail_id")
    private Integer posDetailId;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "pos_detail_discount")
    private BigDecimal posDetailDiscount;
    @Column(name = "pos_detail_price")
    private BigDecimal posDetailPrice;
    @Column(name = "pos_detail_nett")
    private BigDecimal posDetailNett;
    @Lob
    @Column(name = "pos_detail_description")
    private String posDetailDescription;
    @JoinColumn(name = "pos_detail_item_id", referencedColumnName = "item_id")
    @ManyToOne
    private GapMasterItem posDetailItemId;
    @JoinColumn(name = "pos_detail_pos_id", referencedColumnName = "pos_id")
    @ManyToOne
    private GapTransactionEmployee posDetailPosId;

    public GapTransactionEmployeeDetail() {
    }

    public GapTransactionEmployeeDetail(Integer posDetailId) {
        this.posDetailId = posDetailId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getPosDetailId() {
        return posDetailId;
    }

    public void setPosDetailId(Integer posDetailId) {
        this.posDetailId = posDetailId;
    }

    public BigDecimal getPosDetailDiscount() {
        return posDetailDiscount;
    }

    public void setPosDetailDiscount(BigDecimal posDetailDiscount) {
        this.posDetailDiscount = posDetailDiscount;
    }

    public BigDecimal getPosDetailPrice() {
        return posDetailPrice;
    }

    public void setPosDetailPrice(BigDecimal posDetailPrice) {
        this.posDetailPrice = posDetailPrice;
    }

    public BigDecimal getPosDetailNett() {
        return posDetailNett;
    }

    public void setPosDetailNett(BigDecimal posDetailNett) {
        this.posDetailNett = posDetailNett;
    }

    public String getPosDetailDescription() {
        return posDetailDescription;
    }

    public void setPosDetailDescription(String posDetailDescription) {
        this.posDetailDescription = posDetailDescription;
    }

    public GapMasterItem getPosDetailItemId() {
        return posDetailItemId;
    }

    public void setPosDetailItemId(GapMasterItem posDetailItemId) {
        this.posDetailItemId = posDetailItemId;
    }

    public GapTransactionEmployee getPosDetailPosId() {
        return posDetailPosId;
    }

    public void setPosDetailPosId(GapTransactionEmployee posDetailPosId) {
        this.posDetailPosId = posDetailPosId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (posDetailId != null ? posDetailId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GapTransactionEmployeeDetail)) {
            return false;
        }
        GapTransactionEmployeeDetail other = (GapTransactionEmployeeDetail) object;
        if ((this.posDetailId == null && other.posDetailId != null) || (this.posDetailId != null && !this.posDetailId.equals(other.posDetailId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.gap.entities.GapTransactionEmployeeDetail[ posDetailId=" + posDetailId + " ]";
    }
    
}
